<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NeuZephyr: D:/Users/Mgepahmge/Documents/C Program/NeuZephyr/include/NeuZephyr/StreamManager.cuh Source File</title>
<link rel="icon" href="NZ_logo2.png" type="image/x-icon" />
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="NZ_logo2.png"/></td>
  <td id="projectalign">
   <div id="projectname">NeuZephyr
   </div>
   <div id="projectbrief">Simple DL Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d522931ffa1371640980b621734a4381.html">Users</a></li><li class="navelem"><a class="el" href="dir_a7e6ee1ae3f772c9504a0b543f2027e2.html">Mgepahmge</a></li><li class="navelem"><a class="el" href="dir_e03f57e346cc4845a4c354a35630b169.html">Documents</a></li><li class="navelem"><a class="el" href="dir_231a0482af2b83c895f27ba7fe745141.html">C Program</a></li><li class="navelem"><a class="el" href="dir_0fa7fc3a0dfd304dbfc9dce9f6facfa2.html">NeuZephyr</a></li><li class="navelem"><a class="el" href="dir_e7295b03dab2e9cdf32139bd8ec2e607.html">include</a></li><li class="navelem"><a class="el" href="dir_657344ecc65cfc28732701509f8d8421.html">NeuZephyr</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">StreamManager.cuh</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#ifndef STREAMMANAGER_CUH</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="preprocessor">#define STREAMMANAGER_CUH</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="preprocessor">#include &lt;curand.h&gt;</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#ifdef __CUDACC__</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#include &lt;cuda_fp16.h&gt;</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#include &quot;<a class="code" href="_event_pool_8cuh.html">EventPool.cuh</a>&quot;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacenz_1_1cu_strm.html">nz::cuStrm</a> {</div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span>    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00131" data-start="{" data-end="};">
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html">  131</a></span>    <span class="keyword">class </span><a class="code hl_class" href="classnz_1_1cu_strm_1_1_stream_manager.html">StreamManager</a> {</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span>        <a class="code hl_class" href="classnz_1_1cu_strm_1_1_stream_manager.html">StreamManager</a>(<span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1cu_strm_1_1_stream_manager.html">StreamManager</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span> </div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>        <a class="code hl_class" href="classnz_1_1cu_strm_1_1_stream_manager.html">StreamManager</a>&amp; operator=(<span class="keyword">const</span> <a class="code hl_class" href="classnz_1_1cu_strm_1_1_stream_manager.html">StreamManager</a>&amp;) = <span class="keyword">delete</span>;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span> </div>
<div class="foldopen" id="foldopen00154" data-start="{" data-end="}">
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#ab4b2eb422e0e1ee44bdfdc0eb94457ce">  154</a></span>        <span class="keyword">static</span> <a class="code hl_class" href="classnz_1_1cu_strm_1_1_stream_manager.html">StreamManager</a>&amp; <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#ab4b2eb422e0e1ee44bdfdc0eb94457ce">Instance</a>() {</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span>            <span class="keyword">static</span> <a class="code hl_class" href="classnz_1_1cu_strm_1_1_stream_manager.html">StreamManager</a> instance(16, 128);</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span>            <span class="keywordflow">return</span> instance;</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span>        }</div>
</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span> </div>
<div class="foldopen" id="foldopen00180" data-start="{" data-end="}">
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#a8e79a1506664e3a235cf7327e6d1275b">  180</a></span>        <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a8e79a1506664e3a235cf7327e6d1275b">~StreamManager</a>() {</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#aa11ff4c21b003e5089f3cd65724b2193">sync</a>();</div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; s : streamPool) {</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span>                cudaStreamDestroy(s);</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span>            }</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno">  185</span>            eventPool.reset();</div>
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno">  186</span>        }</div>
</div>
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno">  187</span> </div>
<div class="foldopen" id="foldopen00230" data-start="{" data-end="}">
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#a97f78a2d43f6e0508c82d4f3b629de96">  230</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a97f78a2d43f6e0508c82d4f3b629de96">malloc</a>(T** data, <span class="keyword">const</span> <span class="keywordtype">size_t</span> size) {</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span>            cudaMallocAsync(data, <span class="keyword">sizeof</span>(T) * size, stream);</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span>            eventPool-&gt;recordData(stream, data);</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span>        }</div>
</div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span> </div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a97f78a2d43f6e0508c82d4f3b629de96">malloc</a>(half** data, <span class="keyword">const</span> <span class="keywordtype">size_t</span> size) {</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span>            cudaMallocAsync(data, <span class="keyword">sizeof</span>(half) * size, stream);</div>
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno">  239</span>            eventPool-&gt;recordData(stream, data);</div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno">  240</span>        }</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno">  241</span> </div>
<div class="foldopen" id="foldopen00263" data-start="{" data-end="}">
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#a785cf34395067f425e032d9bd5e1fa20">  263</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a785cf34395067f425e032d9bd5e1fa20">free</a>(T* data) {</div>
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno">  264</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#abe439fa00c0bd369c0b2345b095ed5af">syncData</a>(data);</div>
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno">  265</span>            cudaFree(data);</div>
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno">  266</span>        }</div>
</div>
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno">  267</span> </div>
<div class="foldopen" id="foldopen00299" data-start="{" data-end="}">
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#ab6803232b9c08d9282b16322a6c7b8a9">  299</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#ab6803232b9c08d9282b16322a6c7b8a9">freeHost</a>(T* data) {</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno">  300</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#abe439fa00c0bd369c0b2345b095ed5af">syncData</a>(data);</div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno">  301</span>            cudaFreeHost(data);</div>
<div class="line"><a id="l00302" name="l00302"></a><span class="lineno">  302</span>        }</div>
</div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno">  303</span> </div>
<div class="foldopen" id="foldopen00325" data-start="{" data-end="}">
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1084057ef6f5b2871c60702209bb4469">  325</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1084057ef6f5b2871c60702209bb4469">freeAsync</a>(T* data) {</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno">  326</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00327" name="l00327"></a><span class="lineno">  327</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(data, stream);</div>
<div class="line"><a id="l00328" name="l00328"></a><span class="lineno">  328</span>            cudaFreeAsync(data, stream);</div>
<div class="line"><a id="l00329" name="l00329"></a><span class="lineno">  329</span>        }</div>
</div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno">  330</span> </div>
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno">  331</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1084057ef6f5b2871c60702209bb4469">freeAsync</a>(half* data) {</div>
<div class="line"><a id="l00332" name="l00332"></a><span class="lineno">  332</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno">  333</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(data, stream);</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno">  334</span>            cudaFreeAsync(data, stream);</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno">  335</span>        }</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno">  336</span> </div>
<div class="foldopen" id="foldopen00360" data-start="{" data-end="}">
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#a71ad766cb2869d3dd6a3931966e81706">  360</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a71ad766cb2869d3dd6a3931966e81706">memset</a>(T* data, <span class="keyword">const</span> <span class="keywordtype">int</span> value, <span class="keyword">const</span> <span class="keywordtype">size_t</span> count) {</div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno">  361</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno">  362</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(data, stream);</div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno">  363</span>            cudaMemsetAsync(data, value, count, stream);</div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno">  364</span>            eventPool-&gt;recordData(stream, data);</div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno">  365</span>        }</div>
</div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno">  366</span> </div>
<div class="foldopen" id="foldopen00391" data-start="{" data-end="}">
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#afa38d5c6db0e6b48c8f74ce8ad0df2bc">  391</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#afa38d5c6db0e6b48c8f74ce8ad0df2bc">memcpy</a>(T* dst, T* src, <span class="keyword">const</span> <span class="keywordtype">size_t</span> size, <span class="keyword">const</span> cudaMemcpyKind kind) {</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno">  392</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno">  393</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(src, stream);</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno">  394</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(dst, stream);</div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno">  395</span>            cudaMemcpyAsync(dst, src, size, kind, stream);</div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno">  396</span>            eventPool-&gt;recordData(stream, dst);</div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno">  397</span>        }</div>
</div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno">  398</span> </div>
<div class="line"><a id="l00470" name="l00470"></a><span class="lineno">  470</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="foldopen" id="foldopen00471" data-start="{" data-end="}">
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#a46ce59b45de432842454aadf00b93791">  471</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a46ce59b45de432842454aadf00b93791">submit</a>(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata, T* idata, Args... args) {</div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno">  472</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00473" name="l00473"></a><span class="lineno">  473</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata, stream);</div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno">  474</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata, stream);</div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno">  475</span>            func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata, idata, args...);</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno">  476</span>            eventPool-&gt;recordData(stream, odata);</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno">  477</span>        }</div>
</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno">  478</span> </div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno">  479</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno">  480</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a46ce59b45de432842454aadf00b93791">submit</a>(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata, T* idata1, T* idata2, Args... args) {</div>
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno">  481</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno">  482</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata1, stream);</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno">  483</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata2, stream);</div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno">  484</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata, stream);</div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno">  485</span>            func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata, idata1, idata2, args...);</div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno">  486</span>            eventPool-&gt;recordData(stream, odata);</div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno">  487</span>        }</div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno">  488</span> </div>
<div class="line"><a id="l00489" name="l00489"></a><span class="lineno">  489</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00490" name="l00490"></a><span class="lineno">  490</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a46ce59b45de432842454aadf00b93791">submit</a>(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata, T* idata1, T* idata2, T* idata3,</div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno">  491</span>                    Args... args) {</div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno">  492</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno">  493</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata1, stream);</div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno">  494</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata2, stream);</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno">  495</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata3, stream);</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno">  496</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata, stream);</div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno">  497</span>            func&lt;&lt;&lt;grid, block,shared, stream&gt;&gt;&gt;(odata, idata1, idata2, idata3, args...);</div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno">  498</span>            eventPool-&gt;recordData(stream, odata);</div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno">  499</span>        }</div>
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno">  500</span> </div>
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno">  501</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00502" name="l00502"></a><span class="lineno">  502</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a46ce59b45de432842454aadf00b93791">submit</a>(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, half* odata, T* idata1, Args... args) {</div>
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno">  503</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00504" name="l00504"></a><span class="lineno">  504</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata1, stream);</div>
<div class="line"><a id="l00505" name="l00505"></a><span class="lineno">  505</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata, stream);</div>
<div class="line"><a id="l00506" name="l00506"></a><span class="lineno">  506</span>            func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata, idata1, args...);</div>
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno">  507</span>            eventPool-&gt;recordData(stream, odata);</div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno">  508</span>        }</div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno">  509</span> </div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno">  510</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno">  511</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a46ce59b45de432842454aadf00b93791">submit</a>(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata, half* idata1, half* idata2, Args... args) {</div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno">  512</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno">  513</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata1, stream);</div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno">  514</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata2, stream);</div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno">  515</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata, stream);</div>
<div class="line"><a id="l00516" name="l00516"></a><span class="lineno">  516</span>            func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata, idata1, idata2, args...);</div>
<div class="line"><a id="l00517" name="l00517"></a><span class="lineno">  517</span>            eventPool-&gt;recordData(stream, odata);</div>
<div class="line"><a id="l00518" name="l00518"></a><span class="lineno">  518</span>        }</div>
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno">  519</span> </div>
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno">  520</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00521" name="l00521"></a><span class="lineno">  521</span>        <span class="keywordtype">void</span> submitDualOut(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata1, T* odata2, T* idata1,</div>
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno">  522</span>                           Args... args) {</div>
<div class="line"><a id="l00523" name="l00523"></a><span class="lineno">  523</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno">  524</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata1, stream);</div>
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno">  525</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata1, stream);</div>
<div class="line"><a id="l00526" name="l00526"></a><span class="lineno">  526</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata2, stream);</div>
<div class="line"><a id="l00527" name="l00527"></a><span class="lineno">  527</span>            func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata1, odata2, idata1, args...);</div>
<div class="line"><a id="l00528" name="l00528"></a><span class="lineno">  528</span>            eventPool-&gt;recordData(stream, odata1);</div>
<div class="line"><a id="l00529" name="l00529"></a><span class="lineno">  529</span>            eventPool-&gt;recordData(stream, odata2);</div>
<div class="line"><a id="l00530" name="l00530"></a><span class="lineno">  530</span>        }</div>
<div class="line"><a id="l00531" name="l00531"></a><span class="lineno">  531</span> </div>
<div class="line"><a id="l00532" name="l00532"></a><span class="lineno">  532</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno">  533</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a46ce59b45de432842454aadf00b93791">submit</a>(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata, Args... args) {</div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno">  534</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00535" name="l00535"></a><span class="lineno">  535</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata, stream);</div>
<div class="line"><a id="l00536" name="l00536"></a><span class="lineno">  536</span>            func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata, args...);</div>
<div class="line"><a id="l00537" name="l00537"></a><span class="lineno">  537</span>            eventPool-&gt;recordData(stream, odata);</div>
<div class="line"><a id="l00538" name="l00538"></a><span class="lineno">  538</span>        }</div>
<div class="line"><a id="l00539" name="l00539"></a><span class="lineno">  539</span> </div>
<div class="line"><a id="l00540" name="l00540"></a><span class="lineno">  540</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00541" name="l00541"></a><span class="lineno">  541</span>        <span class="keywordtype">void</span> submitTripleOut(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata1, T* odata2, T* odata3, T* idata1,</div>
<div class="line"><a id="l00542" name="l00542"></a><span class="lineno">  542</span>                             Args... args) {</div>
<div class="line"><a id="l00543" name="l00543"></a><span class="lineno">  543</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00544" name="l00544"></a><span class="lineno">  544</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata1, stream);</div>
<div class="line"><a id="l00545" name="l00545"></a><span class="lineno">  545</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata1, stream);</div>
<div class="line"><a id="l00546" name="l00546"></a><span class="lineno">  546</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata2, stream);</div>
<div class="line"><a id="l00547" name="l00547"></a><span class="lineno">  547</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata3, stream);</div>
<div class="line"><a id="l00548" name="l00548"></a><span class="lineno">  548</span>            func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata1, odata2, odata3, idata1, args...);</div>
<div class="line"><a id="l00549" name="l00549"></a><span class="lineno">  549</span>            eventPool-&gt;recordData(stream, odata1);</div>
<div class="line"><a id="l00550" name="l00550"></a><span class="lineno">  550</span>            eventPool-&gt;recordData(stream, odata2);</div>
<div class="line"><a id="l00551" name="l00551"></a><span class="lineno">  551</span>            eventPool-&gt;recordData(stream, odata3);</div>
<div class="line"><a id="l00552" name="l00552"></a><span class="lineno">  552</span>        }</div>
<div class="line"><a id="l00553" name="l00553"></a><span class="lineno">  553</span> </div>
<div class="line"><a id="l00554" name="l00554"></a><span class="lineno">  554</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00555" name="l00555"></a><span class="lineno">  555</span>        <span class="keywordtype">void</span> submitQuadOut(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata1, T* odata2, T* odata3, T* odata4,</div>
<div class="line"><a id="l00556" name="l00556"></a><span class="lineno">  556</span>                           T* idata1, Args... args) {</div>
<div class="line"><a id="l00557" name="l00557"></a><span class="lineno">  557</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00558" name="l00558"></a><span class="lineno">  558</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata1, stream);</div>
<div class="line"><a id="l00559" name="l00559"></a><span class="lineno">  559</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata1, stream);</div>
<div class="line"><a id="l00560" name="l00560"></a><span class="lineno">  560</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata2, stream);</div>
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno">  561</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata3, stream);</div>
<div class="line"><a id="l00562" name="l00562"></a><span class="lineno">  562</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata4, stream);</div>
<div class="line"><a id="l00563" name="l00563"></a><span class="lineno">  563</span>            func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata1, odata2, odata3, odata4, idata1, args...);</div>
<div class="line"><a id="l00564" name="l00564"></a><span class="lineno">  564</span>            eventPool-&gt;recordData(stream, odata1);</div>
<div class="line"><a id="l00565" name="l00565"></a><span class="lineno">  565</span>            eventPool-&gt;recordData(stream, odata2);</div>
<div class="line"><a id="l00566" name="l00566"></a><span class="lineno">  566</span>            eventPool-&gt;recordData(stream, odata3);</div>
<div class="line"><a id="l00567" name="l00567"></a><span class="lineno">  567</span>            eventPool-&gt;recordData(stream, odata4);</div>
<div class="line"><a id="l00568" name="l00568"></a><span class="lineno">  568</span>        }</div>
<div class="line"><a id="l00569" name="l00569"></a><span class="lineno">  569</span> </div>
<div class="line"><a id="l00570" name="l00570"></a><span class="lineno">  570</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00571" name="l00571"></a><span class="lineno">  571</span>        <span class="keywordtype">void</span> submitParallel(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata, T* idata1, T* idata2,</div>
<div class="line"><a id="l00572" name="l00572"></a><span class="lineno">  572</span>                            <span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; offset_o,</div>
<div class="line"><a id="l00573" name="l00573"></a><span class="lineno">  573</span>                            <span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; offset_i1, <span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; offset_i2, Args... args) {</div>
<div class="line"><a id="l00574" name="l00574"></a><span class="lineno">  574</span>            <span class="keywordflow">if</span> (offset_o.size() != offset_i1.size() || offset_o.size() != offset_i2.size()) {</div>
<div class="line"><a id="l00575" name="l00575"></a><span class="lineno">  575</span>                <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">&quot;Size of offset is not uniform&quot;</span>);</div>
<div class="line"><a id="l00576" name="l00576"></a><span class="lineno">  576</span>            }</div>
<div class="line"><a id="l00577" name="l00577"></a><span class="lineno">  577</span>            std::vector&lt;cudaStream_t&gt; streams;</div>
<div class="line"><a id="l00578" name="l00578"></a><span class="lineno">  578</span>            <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; offset_o.size(); ++i) {</div>
<div class="line"><a id="l00579" name="l00579"></a><span class="lineno">  579</span>                cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno">  580</span>                streams.push_back(stream);</div>
<div class="line"><a id="l00581" name="l00581"></a><span class="lineno">  581</span>                <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata1, stream);</div>
<div class="line"><a id="l00582" name="l00582"></a><span class="lineno">  582</span>                <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata2, stream);</div>
<div class="line"><a id="l00583" name="l00583"></a><span class="lineno">  583</span>                <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata, stream);</div>
<div class="line"><a id="l00584" name="l00584"></a><span class="lineno">  584</span>                func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata, idata1, idata2, args..., offset_o[i], offset_i1[i],</div>
<div class="line"><a id="l00585" name="l00585"></a><span class="lineno">  585</span>                                                      offset_i2[i]);</div>
<div class="line"><a id="l00586" name="l00586"></a><span class="lineno">  586</span>            }</div>
<div class="line"><a id="l00587" name="l00587"></a><span class="lineno">  587</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span> stream : streams) {</div>
<div class="line"><a id="l00588" name="l00588"></a><span class="lineno">  588</span>                eventPool-&gt;recordData(stream, odata);</div>
<div class="line"><a id="l00589" name="l00589"></a><span class="lineno">  589</span>            }</div>
<div class="line"><a id="l00590" name="l00590"></a><span class="lineno">  590</span>        }</div>
<div class="line"><a id="l00591" name="l00591"></a><span class="lineno">  591</span> </div>
<div class="line"><a id="l00592" name="l00592"></a><span class="lineno">  592</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00593" name="l00593"></a><span class="lineno">  593</span>        <span class="keywordtype">void</span> submitParallel(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata, T* idata1,</div>
<div class="line"><a id="l00594" name="l00594"></a><span class="lineno">  594</span>                            <span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; offset_o,</div>
<div class="line"><a id="l00595" name="l00595"></a><span class="lineno">  595</span>                            Args... args) {</div>
<div class="line"><a id="l00596" name="l00596"></a><span class="lineno">  596</span>            std::vector&lt;cudaStream_t&gt; streams;</div>
<div class="line"><a id="l00597" name="l00597"></a><span class="lineno">  597</span>            <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> i : offset_o) {</div>
<div class="line"><a id="l00598" name="l00598"></a><span class="lineno">  598</span>                cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00599" name="l00599"></a><span class="lineno">  599</span>                streams.push_back(stream);</div>
<div class="line"><a id="l00600" name="l00600"></a><span class="lineno">  600</span>                <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata1, stream);</div>
<div class="line"><a id="l00601" name="l00601"></a><span class="lineno">  601</span>                <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata, stream);</div>
<div class="line"><a id="l00602" name="l00602"></a><span class="lineno">  602</span>                func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata, idata1, args..., i);</div>
<div class="line"><a id="l00603" name="l00603"></a><span class="lineno">  603</span>            }</div>
<div class="line"><a id="l00604" name="l00604"></a><span class="lineno">  604</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span> stream : streams) {</div>
<div class="line"><a id="l00605" name="l00605"></a><span class="lineno">  605</span>                eventPool-&gt;recordData(stream, odata);</div>
<div class="line"><a id="l00606" name="l00606"></a><span class="lineno">  606</span>            }</div>
<div class="line"><a id="l00607" name="l00607"></a><span class="lineno">  607</span>        }</div>
<div class="line"><a id="l00608" name="l00608"></a><span class="lineno">  608</span> </div>
<div class="line"><a id="l00609" name="l00609"></a><span class="lineno">  609</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> F, <span class="keyword">typename</span>... Args&gt;</div>
<div class="line"><a id="l00610" name="l00610"></a><span class="lineno">  610</span>        <span class="keywordtype">void</span> submitParallel(F func, dim3 grid, dim3 block, <span class="keywordtype">size_t</span> shared, T* odata, T* idata1,</div>
<div class="line"><a id="l00611" name="l00611"></a><span class="lineno">  611</span>                            <span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; offset_o,</div>
<div class="line"><a id="l00612" name="l00612"></a><span class="lineno">  612</span>                            <span class="keyword">const</span> std::vector&lt;size_t&gt;&amp; offset_i,</div>
<div class="line"><a id="l00613" name="l00613"></a><span class="lineno">  613</span>                            Args... args) {</div>
<div class="line"><a id="l00614" name="l00614"></a><span class="lineno">  614</span>            std::vector&lt;cudaStream_t&gt; streams;</div>
<div class="line"><a id="l00615" name="l00615"></a><span class="lineno">  615</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span> i = 0; i &lt; offset_o.size(); ++i) {</div>
<div class="line"><a id="l00616" name="l00616"></a><span class="lineno">  616</span>                cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00617" name="l00617"></a><span class="lineno">  617</span>                streams.push_back(stream);</div>
<div class="line"><a id="l00618" name="l00618"></a><span class="lineno">  618</span>                <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(idata1, stream);</div>
<div class="line"><a id="l00619" name="l00619"></a><span class="lineno">  619</span>                <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(odata, stream);</div>
<div class="line"><a id="l00620" name="l00620"></a><span class="lineno">  620</span>                func&lt;&lt;&lt;grid, block, shared, stream&gt;&gt;&gt;(odata, idata1, args..., offset_o[i], offset_i[i]);</div>
<div class="line"><a id="l00621" name="l00621"></a><span class="lineno">  621</span>            }</div>
<div class="line"><a id="l00622" name="l00622"></a><span class="lineno">  622</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span> stream : streams) {</div>
<div class="line"><a id="l00623" name="l00623"></a><span class="lineno">  623</span>                eventPool-&gt;recordData(stream, odata);</div>
<div class="line"><a id="l00624" name="l00624"></a><span class="lineno">  624</span>            }</div>
<div class="line"><a id="l00625" name="l00625"></a><span class="lineno">  625</span>        }</div>
<div class="line"><a id="l00626" name="l00626"></a><span class="lineno">  626</span> </div>
<div class="foldopen" id="foldopen00671" data-start="{" data-end="}">
<div class="line"><a id="l00671" name="l00671"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#aa11ff4c21b003e5089f3cd65724b2193">  671</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#aa11ff4c21b003e5089f3cd65724b2193">sync</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00672" name="l00672"></a><span class="lineno">  672</span>            <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> s : streamPool) {</div>
<div class="line"><a id="l00673" name="l00673"></a><span class="lineno">  673</span>                cudaStreamSynchronize(s);</div>
<div class="line"><a id="l00674" name="l00674"></a><span class="lineno">  674</span>            }</div>
<div class="line"><a id="l00675" name="l00675"></a><span class="lineno">  675</span>        }</div>
</div>
<div class="line"><a id="l00676" name="l00676"></a><span class="lineno">  676</span> </div>
<div class="foldopen" id="foldopen00714" data-start="{" data-end="}">
<div class="line"><a id="l00714" name="l00714"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#abe439fa00c0bd369c0b2345b095ed5af">  714</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#abe439fa00c0bd369c0b2345b095ed5af">syncData</a>(T* data) {</div>
<div class="line"><a id="l00715" name="l00715"></a><span class="lineno">  715</span>            eventPool-&gt;syncData(data);</div>
<div class="line"><a id="l00716" name="l00716"></a><span class="lineno">  716</span>        }</div>
</div>
<div class="line"><a id="l00717" name="l00717"></a><span class="lineno">  717</span> </div>
<div class="foldopen" id="foldopen00757" data-start="{" data-end="}">
<div class="line"><a id="l00757" name="l00757"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#a731986c2c4ecd056562eaddadef46df8">  757</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a731986c2c4ecd056562eaddadef46df8">randomize</a>(T* data, <span class="keywordtype">size_t</span> size, <span class="keywordtype">size_t</span> seed, curandRngType_t rngType) {</div>
<div class="line"><a id="l00758" name="l00758"></a><span class="lineno">  758</span>            cudaStream_t stream = <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>();</div>
<div class="line"><a id="l00759" name="l00759"></a><span class="lineno">  759</span>            curandGenerator_t gen;</div>
<div class="line"><a id="l00760" name="l00760"></a><span class="lineno">  760</span>            curandCreateGenerator(&amp;gen, rngType);</div>
<div class="line"><a id="l00761" name="l00761"></a><span class="lineno">  761</span>            curandSetStream(gen, stream);</div>
<div class="line"><a id="l00762" name="l00762"></a><span class="lineno">  762</span>            curandSetPseudoRandomGeneratorSeed(gen, seed);</div>
<div class="line"><a id="l00763" name="l00763"></a><span class="lineno">  763</span>            <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(data, stream);</div>
<div class="line"><a id="l00764" name="l00764"></a><span class="lineno">  764</span>            curandGenerateUniform(gen, data, size);</div>
<div class="line"><a id="l00765" name="l00765"></a><span class="lineno">  765</span>            eventPool-&gt;recordData(stream, data);</div>
<div class="line"><a id="l00766" name="l00766"></a><span class="lineno">  766</span>            curandDestroyGenerator(gen);</div>
<div class="line"><a id="l00767" name="l00767"></a><span class="lineno">  767</span>        }</div>
</div>
<div class="line"><a id="l00768" name="l00768"></a><span class="lineno">  768</span> </div>
<div class="foldopen" id="foldopen00799" data-start="{" data-end="}">
<div class="line"><a id="l00799" name="l00799"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">  799</a></span>        cudaStream_t <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">getStream</a>() {</div>
<div class="line"><a id="l00800" name="l00800"></a><span class="lineno">  800</span>            std::lock_guard&lt;std::mutex&gt; lock(mtx);</div>
<div class="line"><a id="l00801" name="l00801"></a><span class="lineno">  801</span>            <span class="keyword">const</span> <span class="keyword">auto</span> <span class="keywordtype">id</span> = streamQueue.front();</div>
<div class="line"><a id="l00802" name="l00802"></a><span class="lineno">  802</span>            streamQueue.pop();</div>
<div class="line"><a id="l00803" name="l00803"></a><span class="lineno">  803</span>            streamQueue.push(<span class="keywordtype">id</span>);</div>
<div class="line"><a id="l00804" name="l00804"></a><span class="lineno">  804</span>            <span class="keywordflow">return</span> streamPool[id];</div>
<div class="line"><a id="l00805" name="l00805"></a><span class="lineno">  805</span>        }</div>
</div>
<div class="line"><a id="l00806" name="l00806"></a><span class="lineno">  806</span> </div>
<div class="foldopen" id="foldopen00840" data-start="{" data-end="}">
<div class="line"><a id="l00840" name="l00840"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">  840</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(T* data, cudaStream_t stream) {</div>
<div class="line"><a id="l00841" name="l00841"></a><span class="lineno">  841</span>            <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> e : eventPool-&gt;getEvents(data)) {</div>
<div class="line"><a id="l00842" name="l00842"></a><span class="lineno">  842</span>                cudaStreamWaitEvent(stream, e, 0);</div>
<div class="line"><a id="l00843" name="l00843"></a><span class="lineno">  843</span>            }</div>
<div class="line"><a id="l00844" name="l00844"></a><span class="lineno">  844</span>        }</div>
</div>
<div class="line"><a id="l00845" name="l00845"></a><span class="lineno">  845</span> </div>
<div class="line"><a id="l00846" name="l00846"></a><span class="lineno">  846</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">streamWait</a>(half* data, cudaStream_t stream) {</div>
<div class="line"><a id="l00847" name="l00847"></a><span class="lineno">  847</span>            <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> e : eventPool-&gt;getEvents(data)) {</div>
<div class="line"><a id="l00848" name="l00848"></a><span class="lineno">  848</span>                cudaStreamWaitEvent(stream, e, 0);</div>
<div class="line"><a id="l00849" name="l00849"></a><span class="lineno">  849</span>            }</div>
<div class="line"><a id="l00850" name="l00850"></a><span class="lineno">  850</span>        }</div>
<div class="line"><a id="l00851" name="l00851"></a><span class="lineno">  851</span> </div>
<div class="foldopen" id="foldopen00886" data-start="{" data-end="}">
<div class="line"><a id="l00886" name="l00886"></a><span class="lineno"><a class="line" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1260d95d0eddf75b72700da07361a4bd">  886</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1260d95d0eddf75b72700da07361a4bd">recordData</a>(T* data, cudaStream_t stream) {</div>
<div class="line"><a id="l00887" name="l00887"></a><span class="lineno">  887</span>            eventPool-&gt;recordData(stream, data);</div>
<div class="line"><a id="l00888" name="l00888"></a><span class="lineno">  888</span>        }</div>
</div>
<div class="line"><a id="l00889" name="l00889"></a><span class="lineno">  889</span> </div>
<div class="line"><a id="l00890" name="l00890"></a><span class="lineno">  890</span>        <span class="keywordtype">void</span> <a class="code hl_function" href="classnz_1_1cu_strm_1_1_stream_manager.html#a1260d95d0eddf75b72700da07361a4bd">recordData</a>(half* data, cudaStream_t stream) {</div>
<div class="line"><a id="l00891" name="l00891"></a><span class="lineno">  891</span>            eventPool-&gt;recordData(stream, data);</div>
<div class="line"><a id="l00892" name="l00892"></a><span class="lineno">  892</span>        }</div>
<div class="line"><a id="l00893" name="l00893"></a><span class="lineno">  893</span> </div>
<div class="line"><a id="l00894" name="l00894"></a><span class="lineno">  894</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00895" name="l00895"></a><span class="lineno">  895</span>        std::vector&lt;cudaStream_t&gt; streamPool;</div>
<div class="line"><a id="l00896" name="l00896"></a><span class="lineno">  896</span>        std::queue&lt;int&gt; streamQueue;</div>
<div class="line"><a id="l00897" name="l00897"></a><span class="lineno">  897</span>        std::shared_ptr&lt;EventPool&gt; eventPool;</div>
<div class="line"><a id="l00898" name="l00898"></a><span class="lineno">  898</span>        uint32_t maxStream;</div>
<div class="line"><a id="l00899" name="l00899"></a><span class="lineno">  899</span>        std::mutex mtx;</div>
<div class="line"><a id="l00900" name="l00900"></a><span class="lineno">  900</span> </div>
<div class="line"><a id="l00901" name="l00901"></a><span class="lineno">  901</span>        <span class="keyword">explicit</span> StreamManager(<span class="keyword">const</span> uint32_t maxStream = 16, <span class="keyword">const</span> uint32_t maxEvent = 128) :</div>
<div class="line"><a id="l00902" name="l00902"></a><span class="lineno">  902</span>            eventPool(std::make_shared&lt;EventPool&gt;(maxEvent)), maxStream(maxStream) {</div>
<div class="line"><a id="l00903" name="l00903"></a><span class="lineno">  903</span>            cudaFree(0);</div>
<div class="line"><a id="l00904" name="l00904"></a><span class="lineno">  904</span>            <span class="keywordflow">for</span> (uint32_t i = 0; i &lt; maxStream; ++i) {</div>
<div class="line"><a id="l00905" name="l00905"></a><span class="lineno">  905</span>                cudaStream_t stream;</div>
<div class="line"><a id="l00906" name="l00906"></a><span class="lineno">  906</span>                cudaStreamCreateWithFlags(&amp;stream, cudaStreamNonBlocking);</div>
<div class="line"><a id="l00907" name="l00907"></a><span class="lineno">  907</span>                streamPool.push_back(stream);</div>
<div class="line"><a id="l00908" name="l00908"></a><span class="lineno">  908</span>                streamQueue.push(i);</div>
<div class="line"><a id="l00909" name="l00909"></a><span class="lineno">  909</span>            }</div>
<div class="line"><a id="l00910" name="l00910"></a><span class="lineno">  910</span>        }</div>
<div class="line"><a id="l00911" name="l00911"></a><span class="lineno">  911</span>    };</div>
</div>
<div class="line"><a id="l00912" name="l00912"></a><span class="lineno">  912</span>}</div>
<div class="line"><a id="l00913" name="l00913"></a><span class="lineno">  913</span> </div>
<div class="line"><a id="l00914" name="l00914"></a><span class="lineno">  914</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00915" name="l00915"></a><span class="lineno">  915</span><span class="preprocessor">#endif </span><span class="comment">//STREAMMANAGER_CUH</span></div>
<div class="ttc" id="a_event_pool_8cuh_html"><div class="ttname"><a href="_event_pool_8cuh.html">EventPool.cuh</a></div><div class="ttdoc">Definition of the EventPool class for managing CUDA events in multi-stream environments.</div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html">nz::cuStrm::StreamManager</a></div><div class="ttdoc">Centralized CUDA stream and resource management system with automatic dependency tracking.</div><div class="ttdef"><b>Definition</b> <a href="#l00131">StreamManager.cuh:131</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_a1084057ef6f5b2871c60702209bb4469"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#a1084057ef6f5b2871c60702209bb4469">nz::cuStrm::StreamManager::freeAsync</a></div><div class="ttdeci">void freeAsync(T *data)</div><div class="ttdoc">Asynchronously frees the CUDA device memory pointed to by the given pointer.</div><div class="ttdef"><b>Definition</b> <a href="#l00325">StreamManager.cuh:325</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_a1260d95d0eddf75b72700da07361a4bd"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#a1260d95d0eddf75b72700da07361a4bd">nz::cuStrm::StreamManager::recordData</a></div><div class="ttdeci">void recordData(T *data, cudaStream_t stream)</div><div class="ttdoc">Records write completion event for asynchronous data operations.</div><div class="ttdef"><b>Definition</b> <a href="#l00886">StreamManager.cuh:886</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_a1de1cf3aadea137faf90a2f9b4b7abe2"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#a1de1cf3aadea137faf90a2f9b4b7abe2">nz::cuStrm::StreamManager::getStream</a></div><div class="ttdeci">cudaStream_t getStream()</div><div class="ttdoc">Acquires CUDA stream from pool using round-robin scheduling.</div><div class="ttdef"><b>Definition</b> <a href="#l00799">StreamManager.cuh:799</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_a46ce59b45de432842454aadf00b93791"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#a46ce59b45de432842454aadf00b93791">nz::cuStrm::StreamManager::submit</a></div><div class="ttdeci">void submit(F func, dim3 grid, dim3 block, size_t shared, T *odata, T *idata, Args... args)</div><div class="ttdoc">Asynchronously submits a CUDA kernel with stream-ordered dependency management.</div><div class="ttdef"><b>Definition</b> <a href="#l00471">StreamManager.cuh:471</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_a71ad766cb2869d3dd6a3931966e81706"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#a71ad766cb2869d3dd6a3931966e81706">nz::cuStrm::StreamManager::memset</a></div><div class="ttdeci">void memset(T *data, const int value, const size_t count)</div><div class="ttdoc">Asynchronously sets a block of CUDA device memory to a specified value.</div><div class="ttdef"><b>Definition</b> <a href="#l00360">StreamManager.cuh:360</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_a731986c2c4ecd056562eaddadef46df8"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#a731986c2c4ecd056562eaddadef46df8">nz::cuStrm::StreamManager::randomize</a></div><div class="ttdeci">void randomize(T *data, size_t size, size_t seed, curandRngType_t rngType)</div><div class="ttdoc">Generates uniformly distributed random numbers on GPU using CURAND.</div><div class="ttdef"><b>Definition</b> <a href="#l00757">StreamManager.cuh:757</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_a785cf34395067f425e032d9bd5e1fa20"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#a785cf34395067f425e032d9bd5e1fa20">nz::cuStrm::StreamManager::free</a></div><div class="ttdeci">void free(T *data)</div><div class="ttdoc">Frees the CUDA device memory pointed to by the given pointer.</div><div class="ttdef"><b>Definition</b> <a href="#l00263">StreamManager.cuh:263</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_a8e79a1506664e3a235cf7327e6d1275b"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#a8e79a1506664e3a235cf7327e6d1275b">nz::cuStrm::StreamManager::~StreamManager</a></div><div class="ttdeci">~StreamManager()</div><div class="ttdoc">Destructor for the StreamManager class.</div><div class="ttdef"><b>Definition</b> <a href="#l00180">StreamManager.cuh:180</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_a97f78a2d43f6e0508c82d4f3b629de96"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#a97f78a2d43f6e0508c82d4f3b629de96">nz::cuStrm::StreamManager::malloc</a></div><div class="ttdeci">void malloc(T **data, const size_t size)</div><div class="ttdoc">Asynchronously allocates device memory for type-specific data with stream-ordered dependency tracking...</div><div class="ttdef"><b>Definition</b> <a href="#l00230">StreamManager.cuh:230</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_aa11ff4c21b003e5089f3cd65724b2193"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#aa11ff4c21b003e5089f3cd65724b2193">nz::cuStrm::StreamManager::sync</a></div><div class="ttdeci">void sync() const</div><div class="ttdoc">Synchronizes all CUDA streams in the stream pool by blocking the host thread.</div><div class="ttdef"><b>Definition</b> <a href="#l00671">StreamManager.cuh:671</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_ab4b2eb422e0e1ee44bdfdc0eb94457ce"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#ab4b2eb422e0e1ee44bdfdc0eb94457ce">nz::cuStrm::StreamManager::Instance</a></div><div class="ttdeci">static StreamManager &amp; Instance()</div><div class="ttdoc">Returns a reference to the singleton instance of the StreamManager.</div><div class="ttdef"><b>Definition</b> <a href="#l00154">StreamManager.cuh:154</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_ab6803232b9c08d9282b16322a6c7b8a9"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#ab6803232b9c08d9282b16322a6c7b8a9">nz::cuStrm::StreamManager::freeHost</a></div><div class="ttdeci">void freeHost(T *data)</div><div class="ttdoc">Frees the pinned host memory pointed to by the given pointer.</div><div class="ttdef"><b>Definition</b> <a href="#l00299">StreamManager.cuh:299</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_abe439fa00c0bd369c0b2345b095ed5af"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#abe439fa00c0bd369c0b2345b095ed5af">nz::cuStrm::StreamManager::syncData</a></div><div class="ttdeci">void syncData(T *data)</div><div class="ttdoc">Synchronizes host thread with completion events for a specific data object.</div><div class="ttdef"><b>Definition</b> <a href="#l00714">StreamManager.cuh:714</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_adb1078a67c6e38932d7d58c2adb05ec0"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#adb1078a67c6e38932d7d58c2adb05ec0">nz::cuStrm::StreamManager::streamWait</a></div><div class="ttdeci">void streamWait(T *data, cudaStream_t stream)</div><div class="ttdoc">Synchronizes CUDA stream execution until data writes complete.</div><div class="ttdef"><b>Definition</b> <a href="#l00840">StreamManager.cuh:840</a></div></div>
<div class="ttc" id="aclassnz_1_1cu_strm_1_1_stream_manager_html_afa38d5c6db0e6b48c8f74ce8ad0df2bc"><div class="ttname"><a href="classnz_1_1cu_strm_1_1_stream_manager.html#afa38d5c6db0e6b48c8f74ce8ad0df2bc">nz::cuStrm::StreamManager::memcpy</a></div><div class="ttdeci">void memcpy(T *dst, T *src, const size_t size, const cudaMemcpyKind kind)</div><div class="ttdoc">Asynchronously copies data between CUDA device and host memory based on the specified memory copy kin...</div><div class="ttdef"><b>Definition</b> <a href="#l00391">StreamManager.cuh:391</a></div></div>
<div class="ttc" id="anamespacenz_1_1cu_strm_html"><div class="ttname"><a href="namespacenz_1_1cu_strm.html">nz::cuStrm</a></div><div class="ttdoc">Provides core components for CUDA stream and event lifecycle management in GPU computing environments...</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
